#ifndef __graph_H__
#define __graph_H__

#define Default_Vertex_Size 10       //默认顶点数
#define datatype char 
#define MAX_COST 0x7FFFFFFF         

typedef struct Graph
{
	int MaxVertex;
	int NumVertex;
	int NumEdge;
	datatype *VertexList;
	int **Edge;
}Graph;

int Init(Graph *);
void Show(Graph *graph);
int InsertVertex(Graph * graph,datatype  vertex);
int InsertEdge(Graph *graph, datatype vertex1, datatype vertex2,int cost);
int GetVertexPosition(Graph * graph,datatype vertex);
int RemoveVertex1(Graph *graph, datatype vertex); //删除顶点方法1：删除顶点的后续顶点前移一位
int RemoveVertex2(Graph *graph, datatype vertex); //删除顶点方法2：末尾顶点顶替删除顶点的位置
int RemoveEdge(Graph * graph,datatype vertex1,datatype vertex2);
void DestoryGraph(Graph * graph);
int GetFirstNeighbor(Graph * graph,datatype vertex);
int GetNextNeighbor(Graph * graph,datatype vertex1,datatype vertex2);

//===============================================================
void CriticalPath(Graph *graph);
int GetWeight(Graph *graph,int v1,int v2);


#endif
